<?php

class DefaultController extends Controller
{
    public $title = '«Автомир Стерлитамака» - Бесплатная газета частных объявлений для автомобилистов';

	public function actionIndex()
	{
		$this->render('index');
	}

    public function actionView($id){
        $model = Article::model()->findByPk($id);
        $this->title = $model->title.' - '.$this->title;
        $this->render('index', array('model' => $model));
    }

    public function actionContacts(){
        $model = Article::model()->findByPk(Config::model()->getValue('contacts'));
        $this->title = $model->title.' - '.$this->title;
        $this->render('index', array('model' => $model));
    }

    public function actionReklama(){
        $model = Article::model()->findByPk(Config::model()->getValue('reklama'));
        $this->title = $model->title.' - '.$this->title;
        $this->render('index', array('model' => $model));
    }

    public function actionAbout(){
        $model = Article::model()->findByPk(Config::model()->getValue('about'));
        $this->title = $model->title.' - '.$this->title;
        $this->render('index', array('model' => $model));
    }

    public function actionUconsults(){
        $model = Article::model()->findByPk(Config::model()->getValue('uconsults'));
        $this->title = $model->title.' - '.$this->title;
        $this->render('index', array('model' => $model));
    }
}